package org.example.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ducai
 * @since 2024-12-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("messages")
public class Messages extends Model<Messages> {

private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 是否删除 0-未删除  1-已删除
     */
    @TableField("is_del")
    private Long isDel;

    /**
     * 删除时间
     */
    @TableField("dele_time")
    private LocalDateTime deleTime;

    /**
     * 发送者的uuid
     */
    @TableField("sender_uuid")
    private String senderUuid;

    /**
     * 接收者的uuid
     */
    @TableField("receiver_uuid")
    private String receiverUuid;

    /**
     * 群聊的id
     */
    @TableField("group_id")
    private Integer groupId;

    /**
     * 消息内容（如果是文本）
     */
    @TableField("content")
    private String content;

    /**
     * 媒体文件的url
     */
    @TableField("media_url")
    private String mediaUrl;

    /**
     * 消息类型
     */
    @TableField("message_type")
    private String messageType;

    /**
     * 消息发送类型
     */
    @TableField("chat_type")
    private String chatType;

    /**
     * 是否已读状态
     */
    @TableField("is_read")
    private Boolean isRead;

    /**
     * 是否已撤回
     */
    @TableField("is_retracted")
    private Boolean isRetracted;


    public static final String ID = "id";

    public static final String UPDATE_TIME = "update_time";

    public static final String CREATE_TIME = "create_time";

    public static final String IS_DEL = "is_del";

    public static final String DELE_TIME = "dele_time";

    public static final String SENDER_UUID = "sender_uuid";

    public static final String RECEIVER_UUID = "receiver_uuid";

    public static final String GROUP_ID = "group_id";

    public static final String CONTENT = "content";

    public static final String MEDIA_URL = "media_url";

    public static final String MESSAGE_TYPE = "message_type";

    public static final String CHAT_TYPE = "chat_type";

    public static final String IS_READ = "is_read";

    public static final String IS_RETRACTED = "is_retracted";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
